<%= form_for(@book_rating) do |f| %>
  <% if @book_rating.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@book_rating.errors.count, "error") %> prohibited this book_rating from being saved:</h2>

      <ul>
      <% @book_rating.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

<h2><%= Collection.find_by_id(@book.collection_id) %> <%= @book.title %></h2>
  <div class="field">
    <%= f.label :rate %><br />
    <%= f.select :rate, options_for_select(0..5), {:prompt => 'Select a collection'} %>
    <%= @book_rating.rate %>
  </div>
  <div class="field">
    <%= f.label :comment %><br />
    <%= f.text_area :comment %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
